﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPageContent.master" AutoEventWireup="false" CodeFile="PurchaseRequestHdr.aspx.vb" Inherits="Purchase_PurchaseRequestHdr" %>

<%@ Register Src="~/UserControls/DDL.ascx" TagName="DoubleFilteredDropDownList" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/OneFilteredDropDownList.ascx" TagName="OneFilteredDropDownList"
    TagPrefix="uc2" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeaderPlaceHolder" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">





    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgPurchaseRequestHdr">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgPurchaseRequestHdr" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Office2010Blue"
        Transparency="20">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>


    <br /><br />




    <telerik:RadGrid ID="rgPurchaseRequestHdr" DataSourceID="odsPurchaseRequestHdr" CellSpacing="0" runat="server"
        AutoGenerateColumns="False" AllowSorting="True"
        Skin="Office2010Blue" AllowPaging="True" GridLines="None" ShowGroupPanel="false" >
        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <MasterTableView DataSourceID="odsPurchaseRequestHdr" CommandItemDisplay="TopAndBottom" DataKeyNames="PurReqID"
            Width="880px" AllowMultiColumnSorting="True" GroupLoadMode="Server" NoMasterRecordsText="<%$ Resources:MainGrid , NoMasterRecordsText %>"
            NoDetailRecordsText="<%$ Resources:MainGrid , NoMasterRecordsText %>" >

    <EditFormSettings>
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
    </EditFormSettings>
            <CommandItemTemplate>
                <table>
                    <tr>
                        <td>
                            <asp:ImageButton ID="ibtnInitInsert" CausesValidation="false" CommandName="Add" runat="server"
                                ImageUrl="~/Design/images/Grid/AddRecord.gif" />
                            <asp:LinkButton ID="lbtnInitInsert" CausesValidation="false" runat="server" Font-Size="14px"
                                Text="<%$ Resources:MainGrid , AddNew %>" Visible="true" CommandName="Add" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ibtnEditSelected" CausesValidation="false" CommandName="Edit"
                                runat="server" ImageUrl="~/Design/images/Grid/Edit.gif" />
                            <asp:LinkButton ID="lbtnEditSelected" CausesValidation="false" runat="server" Font-Size="Medium"
                                Text="<%$ Resources:MainGrid , EditSelected %>" Visible="true" CommandName="Edit" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ibtnDeleteSelected" CausesValidation="false" CommandName="DeleteSelected"
                                OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>" runat="server"
                                ImageUrl="~/Design/images/Grid/Delete.gif" />
                            <asp:LinkButton ID="lbtnDeleteSelected" Font-Size="Medium" CausesValidation="false"
                                OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>" runat="server"
                                Text="<%$ Resources:MainGrid , DeleteSelected %>" CommandName="DeleteSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ibtnRebindGrid" CausesValidation="false" CommandName="RebindGrid"
                                runat="server" ImageUrl="~/Design/images/Grid/Refresh.gif" />
                            <asp:LinkButton ID="lbtnRebindGrid" Font-Size="Medium" CausesValidation="false" runat="server"
                                Text="<%$ Resources:MainGrid , Refresh %>" CommandName="RebindGrid" />
                            <asp:Literal ID="ltrArabicSpace" meta:ResourceKey="ArabicSpace" runat="server">
                            </asp:Literal>
                        </td>
                    </tr>
                </table>
            </CommandItemTemplate>
    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn SortExpression="PurReqID" HeaderButtonType="TextButton" Visible="false"
                     DataField="PurReqID" UniqueName="PurReqID" >
                </telerik:GridBoundColumn>
                
                <telerik:GridBoundColumn SortExpression="PurReqNo" HeaderButtonType="TextButton"
                     DataField="PurReqNo" UniqueName="PurReqNo" meta:ResourceKey="gbcPurReqNo" >
                   <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                   <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridBoundColumn>

                <telerik:GridDateTimeColumn PickerType="DatePicker" SortExpression="PurReqDate"
                    DataFormatString="{0:MM/dd/yyyy}" ShowFilterIcon="false"
                    HeaderButtonType="TextButton" DataField="PurReqDate" UniqueName="PurReqDate"
                    meta:ResourceKey="gbcPurReqDate">
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridDateTimeColumn>

                <telerik:GridDropDownColumn DataField="PurReqType" ListTextField="<%$ Resources:SystemResource, lookup %>"
                    ReadOnly="True" SortExpression="PurReqType" UniqueName="CostCenter" Visible="true"
                    DataSourceID="odsPurReqType" ListValueField="MINOR" meta:ResourceKey="gbcPurReqType">
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridDropDownColumn>

                <telerik:GridDropDownColumn DataField="CostCenter" ListTextField="<%$ Resources:SystemResource, lookup %>"
                    ReadOnly="True" SortExpression="CostCenter" UniqueName="CostCenter" Visible="true"
                    DataSourceID="odsCostCenter" ListValueField="MINOR" meta:ResourceKey="gbcCostCenter">
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridDropDownColumn>

                <telerik:GridDropDownColumn DataField="MainCostCenter" ListTextField="<%$ Resources:SystemResource, lookup %>"
                    ReadOnly="True" SortExpression="MainCostCenter" UniqueName="MainCostCenter" Visible="true"
                    DataSourceID="odsMainCostCenter" ListValueField="MINOR" meta:ResourceKey="gbcMainCostCenter">
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridDropDownColumn>

                <telerik:GridBoundColumn SortExpression="Remarks" HeaderButtonType="TextButton"
                     DataField="Remarks" UniqueName="Remarks" meta:ResourceKey="gbcRemarks">
                   <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                   <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn SortExpression="RecordStatus" HeaderButtonType="TextButton" Visible="false"
                     DataField="RecordStatus" UniqueName="RecordStatus" >
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn SortExpression="LastUpdateBy" HeaderButtonType="TextButton" Visible="false"
                     DataField="LastUpdateBy" UniqueName="LastUpdateBy" >
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn SortExpression="LastUpdateDate" HeaderButtonType="TextButton" Visible="false"
                     DataField="LastUpdateDate" UniqueName="LastUpdateDate" >
                </telerik:GridBoundColumn>
                

            </Columns>
        </MasterTableView>
        <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
        </ExportSettings>
        <GroupingSettings CaseSensitive="false" />
        <ClientSettings EnablePostBackOnRowClick="false">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
    </telerik:RadGrid>

    

    <asp:ObjectDataSource ID="odsPurchaseRequestHdr" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBPurchaseRequestHdrSP" DeleteMethod="QueryDatabase" 
        InsertMethod="QueryDatabase" UpdateMethod="QueryDatabase">
        <InsertParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="SavePurchaseRequestHdr" Name="Operation" Type="String" />
            <asp:Parameter Name="PurReqID" Type="String" />
            <asp:Parameter Name="PurReqNo" Type="String" />
            <asp:Parameter Name="PurReqDate" Type="String" />
            <asp:Parameter Name="PurReqType" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="MainCostCenter" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
            <asp:Parameter Name="RecordStatus" Type="String" />
            <asp:Parameter Name="LastUpdateBy" Type="String" />
            <asp:Parameter Name="LastUpdateDate" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvPurchaseRequestHdr" Name="Operation" Type="String" />
            <asp:Parameter Name="PurReqID" Type="String" />
            <asp:Parameter Name="PurReqNo" Type="String" />
            <asp:Parameter Name="PurReqDate" Type="String" />
            <asp:Parameter Name="PurReqType" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="MainCostCenter" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
            <asp:Parameter Name="RecordStatus" Type="String" />
            <asp:Parameter Name="LastUpdateBy" Type="String" />
            <asp:Parameter Name="LastUpdateDate" Type="String" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="DeletePurchaseRequestHdr" Name="Operation" Type="String" />
            <asp:Parameter Name="PurReqID" Type="String" />
            <asp:Parameter Name="PurReqNo" Type="String" />
            <asp:Parameter Name="PurReqDate" Type="String" />
            <asp:Parameter Name="PurReqType" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="MainCostCenter" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
            <asp:Parameter Name="RecordStatus" Type="String" />
            <asp:Parameter Name="LastUpdateBy" Type="String" />
            <asp:Parameter Name="LastUpdateDate" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="SavePurchaseRequestHdr" Name="Operation" Type="String" />
            <asp:Parameter Name="PurReqID" Type="String" />
            <asp:Parameter Name="PurReqNo" Type="String" />
            <asp:Parameter Name="PurReqDate" Type="String" />
            <asp:Parameter Name="PurReqType" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="MainCostCenter" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
            <asp:Parameter Name="RecordStatus" Type="String" />
            <asp:Parameter Name="LastUpdateBy" Type="String" />
            <asp:Parameter Name="LastUpdateDate" Type="String" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    
    <asp:ObjectDataSource ID="odsCostCenter" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvCostCenter" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="odsMainCostCenter" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvMainCostCenter" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="odsPurReqType" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvPurchaseRequestType" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>



</asp:Content>

